<template>
<div>
<h2>{{ msg }}</h2>
<input type="text" v-model="msg">
<hr>
<h2>{{ msg2 }}</h2>
<input type="text" v-model="msg2">
</div>
</template>

<script setup lang="ts">
import {ref,customRef} from 'vue';
import useMsgRef from './hooks/useMsgRef';
const msg2 = useMsgRef('hello',1000).msg;
// vue提供的默认ref,数据变化会触发视图的更新
const msg = ref('hello');



</script>

<style scoped>


</style>


